﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Media3D;
using System.Windows;
using DataProcessing;
namespace Gene.Render
{
    /// <summary>
    /// 
    /// </summary>
    public class XYPlane : Gene.Render.BackgroudPlane
    {

        public const double X_LEFT = -1.11;
        public const double X_RIGHT = 1.11;
        public const double Z = 1.15;
        public const double Y_UP = 1.4;
        public const double Y_DOWN = -0.1;
 
        protected override Point3DCollection BuildPositions()
        {
            Point3DCollection myPositionCollection = new Point3DCollection();
            myPositionCollection.Add(new Point3D(X_LEFT, Y_UP, Z));
            myPositionCollection.Add(new Point3D(X_LEFT, Y_DOWN, Z));
            myPositionCollection.Add(new Point3D(X_RIGHT, Y_DOWN, Z));
            myPositionCollection.Add(new Point3D(X_RIGHT, Y_UP, Z));

            return myPositionCollection;
        }


     
        /// <summary>
        /// 其实如果不画y轴了，此平面都可以不要，但是暂时保留吧。
        /// </summary>
        protected override void BuildBackgroundDrawer()
        {
            Image = new RenderTargetBitmap(BK_IMG_WIDTH, BK_IMG_HEIGHT, 96, 96, PixelFormats.Pbgra32);
            //DrawingVisual drawingVisual = new DrawingVisual();
            //using (DrawingContext drawingContext = drawingVisual.RenderOpen())
            //{ 

            //    Color fillingColor = new Color();
            //    fillingColor = Colors.LightGreen;

            //    SolidColorBrush brush = new SolidColorBrush(fillingColor);
            //    //Y AXIS
            //    drawingContext.DrawLine(new Pen(brush, BRUSH_THICKNESS), new Point(ARROW_RADIUS, BK_IMG_HEIGHT), new Point(ARROW_RADIUS, 0));
                
            //    //ARROW
            //    drawingContext.DrawLine(new Pen(brush, BRUSH_THICKNESS), new Point(0, ARROW_RADIUS), new Point(ARROW_RADIUS, 0));
            //    drawingContext.DrawLine(new Pen(brush, BRUSH_THICKNESS), new Point(ARROW_RADIUS * 2, ARROW_RADIUS), new Point(ARROW_RADIUS, 0));
            //}   
            //Image.Render(drawingVisual);

            Drawer = new ImageBrush(Image);
        }

     
    }
}
